package com.bjsxt.shop.common.util;

import java.util.ResourceBundle;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class ConstatFinalUtil
{
	public static Logger LOGGER=LogManager.getLogger(ConstatFinalUtil.class);
	
	public static ResourceBundle BUNDLE = ResourceBundle.getBundle("common");
	
	/* 链接超时 */
	public static int CONNECT_TIMEOUT = 10000 ; 
	/* 读取超时 */
	public static int READ_TIMEOUT = 10000 ; 
	
	
	public static JSONObject RESOURCE_JSON=new JSONObject();
	public static JSONObject INFO_JSON=new JSONObject();
	public static String ALLSTR="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
	static{
		FileUtil fileUtil=new FileUtil();
		try{
			String resourceStr=fileUtil.readFile(ConstatFinalUtil.class.getClassLoader().getResourceAsStream("resourceInfo.json"));
			RESOURCE_JSON=(JSONObject)JSON.parse(resourceStr);
			INFO_JSON=RESOURCE_JSON.getJSONObject("info");
			ConstatFinalUtil.LOGGER.info("JSON配置文件");
			
		}catch(Exception e){
			ConstatFinalUtil.LOGGER.info("JSON配置文件转换报错了,",e);
		}
		
	}
}
